#ifndef AT_NETWORK_MQTT_TOPIC_h
#define AT_NETWORK_MQTT_TOPIC_h

#include "base_define.h"

/** MQTT 回调函数 */
typedef void (*MqttCallback)(size_t length, char *body);

class AtNetworkMqttTopic {
  public:
    MqttCallback callback;

    GSM_STRING topic;

  public:
    AtNetworkMqttTopic(MqttCallback callback, size_t size) {
      this->topic = (GSM_STRING)MEM_ALLOC(size);

      memset(this->topic, 0, size);

      this->callback = callback;
    };

    ~AtNetworkMqttTopic() {
      free(this->topic);
    };
};

#endif